import math

def fibonacci(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        a, b = 0, 1
        for _ in range(2, n + 1):
            a, b = b, a + b
        return b

def fibonacci_spiral_length(n):
    total_length = 0
    previous_length = 0
    lengths = []
    ratios = []

    for i in range(1, n + 1):
        fib_i = fibonacci(i)
        arc_length = 2 * math.pi * fib_i
        lengths.append(arc_length)
        total_length += arc_length
        if i > 1:
            ratio = arc_length / previous_length
            ratios.append(ratio)
        previous_length = arc_length

    return total_length, lengths, ratios

total_length, lengths, ratios = fibonacci_spiral_length(50)

print(f"前50步的总长度: {total_length}")
print("每一步的长度:")
for i, length in enumerate(lengths, start=1):
    print(f"第{i}步: {length}")

print("每一步与上一步的长度比:")
for i, ratio in enumerate(ratios, start=2):
    print(f"第{i}步与第{i-1}步的比值: {ratio}")